<?php
include ("../../../include/GraphInclude/jpgraph.php");
include ("../../../include/GraphInclude/jpgraph_scatter.php");

Class ScatterMaker
{
	var $l1datay;
	
	var $l2datay;

	var $xTitle;

	var $yTitle;	

	var $xSize;		

	var $ySize;
	
	function setDataY($array)
	{
		$this->l1datay = $array;
	}
	
	function setDataX($array)
	{
		$this->l2datay = $array;
	}
	
	function setXtitle($text)
	{
		$this->xTitle = $text;
	}

	function setYtitle($text)
	{
		$this->yTitle = $text;
	}

	function setGraphSize($size)
	{
		// ?
		if($size == "0")
		{
			$this->xSize = 800;
			$this->ySize = 300;
		}
		// 
		else if($size == "1")
		{
			$this->xSize = 800;
			$this->ySize = 600;		
		}
		else if($size == "2")
		{
			$this->xSize = 800;
			$this->ySize = 600;
		}
	}
	
	function graphMake()
	{
		$datax = $this->l1datay;
		$datay = $this->l2datay;

		$graph = new Graph($this->xSize,$this->ySize,"auto");
		$graph->SetScale("linlin");

		$graph->img->SetMargin(50,50,20,40);		
		$graph->SetMarginColor(array(233,254,209)); 
		$graph->SetShadow();

		$graph->title->SetFont(FF_MINCHO,FS_NORMAL,7);
		$graph->xaxis->title->Set($this->xTitle);
		//$graph->yaxis->title->Set($this->yTitle);

		$caption=new Text($this->yTitle,0.1,1); 
		$caption->SetFont(FF_GOTHIC,FS_NORMAL,7);
		$caption->SetColor("red"); 
		$graph->AddText($caption);
		
		$graph->xaxis->title->SetFont(FF_MINCHO,FS_NORMAL,7);
		$graph->yaxis->title->SetFont(FF_MINCHO,FS_NORMAL,7);
      
                $graph->xaxis->SetFont(FF_MINCHO,FS_NORMAL,7);
                $graph->yaxis->SetFont(FF_MINCHO,FS_NORMAL,7);

		$sp1 = new ScatterPlot($datay,$datax);
		$graph->Add($sp1);
		$graph->Stroke();		
	}
}
?>
